/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.capex.javacore.polimorfismo;

import java.lang.reflect.Method;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Acer
 */
public class pruebaClass {
    public static void main(String[] args) {
        Date date = new Date();
        Class clase = date.getClass();
        System.out.println(clase);
        System.out.println("");

        Method[] methods = clase.getMethods();
        for(Method temp:methods){
            System.out.println(temp.getName());

            Class<?>[] parameterTypes = temp.getParameterTypes();
            for(Class<?> temp2:parameterTypes){
                System.out.println("\t"+temp2+" ");
            }

            Class<?> returnType = temp.getReturnType();
            System.out.println("\t\t"+returnType);
        }
        System.out.println("");

        try {
            clase = Class.forName("java.lang.String");
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(pruebaClass.class.getName()).log(Level.SEVERE, null, ex);
        }

        System.out.println(clase);
        System.out.println("\n\n\n\n------------------------------------------------\n\n\n\n");

        methods = clase.getMethods();
        for(Method temp:methods){
            System.out.println(temp.getName());

            Class<?>[] parameterTypes = temp.getParameterTypes();
            for(Class<?> temp2:parameterTypes){
                System.out.println("\t"+temp2+" ");
            }

            Class<?> returnType = temp.getReturnType();
            System.out.println("\t\t"+returnType);
        }

    }
}
